package com.sunwayhorizo.health.business.registries.organization;

import java.util.List;

import javax.ejb.Local;

import com.sunwayhorizo.health.business.base.IBaseManager;
import com.sunwayhorizo.health.business.dto.ResultsDTO;
import com.sunwayhorizo.health.business.dto.registries.OrganizationDTO;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.rim.Organization;
import com.sunwayhorizo.health.hl7.rim.Role;

/**
 * 
 * @ClassName OrganizationManagerLocal <br>
 * @PackageName com.sunwayhorizo.health.business.registries.organization <br>
 * @Description 机构管理 <br>
 * @Author jinzw <br>
 * @Date 2011-07-14 <br>
 * @Version 1.0 <br>
 * @ModifiedDesc <br>
 * @ModifiedDate <br>
 * @ModifiedBy <br>
 * @Copyright 2010-2020 horizo All Rights Reserved. <br>
 */
@Local
public interface OrganizationManagerLocal{
	
	
	
	/**
	 * 新增机构
	 * @param entitiesDTO 机构DTO
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
	public ResultsDTO newOrganization(OrganizationDTO organizationDTO) throws Hl7Exception;
	
	/**
	 * 新增机构不持久化机构实体
	 * @param organizationDTO
	 * @return
	 * @throws Hl7Exception
	 */
	public Organization newOrganizationNotPersist(OrganizationDTO organizationDTO) throws Hl7Exception;
	
	/**
	 * 删除一个机构
	 * @param orgIds 机构RIM 实体id集合
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
	@SuppressWarnings("rawtypes")
    public ResultsDTO delOrganization(List orgIds) throws Hl7Exception;
	
	/**
	 * 修改机构
	 * @param entitiesDTO  机构信息
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
	public ResultsDTO updateOrganization(OrganizationDTO entitiesDTO) throws Hl7Exception;
	
	/**
	 * 
	 * 当机构名称 机构编码为空时查询所有的机构
	 * @param orgName 机构名称
	 * @param orgCode 机构编码
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
    public ResultsDTO findOrganizationList(String orgName,String orgCode) throws Hl7Exception ;
    
    /**
     * 根据机构角色组装机构DTO信息 
     * @param orgRole 机构 角色
     * @return OrganizationDTO
     * @throws Hl7Exception
     */
    public OrganizationDTO converOrganizationDtoToOrgRole(Role orgRole) throws Hl7Exception;
    
    /**
     * 根据机构DTO信息给机构实体赋值
     * @param org 机构实体
     * @param organizationDTO 机构DTO信息
     * @throws Hl7Exception
     */
    public void converOrganizationToDto(Organization org,OrganizationDTO organizationDTO) throws Hl7Exception;
	
	
	
}
